an1_waypoint_record* wpt = (an1_waypoint_record*)vwpt;
xfree(wpt->name);
xfree(wpt->fontname);
+
if (wpt->url) {
xfree(wpt->url);
}
if (oldurlstr) {
*oldurlstr = 0;
}
-
wpt->url = (char*) xcalloc(len+1, 1);
memcpy(wpt->url, ofs, len);
ofs += len;
unsigned long i = 0;
an1_waypoint_record* rec = NULL;
waypoint* wpt_tmp;
- char* url = NULL;
char* icon = NULL;
ReadShort(f);
count = ReadLong(f);
wpt_tmp->latitude = DecodeOrd(rec->lat);
wpt_tmp->notes = rec->comment;
wpt_tmp->description = rec->name;
+
if (rec->url) {
wpt_tmp->AddUrlLink(rec->url);
-#if NEW_STRINGS
} else {
int u = wpt_tmp->description.indexOf("{URL=");
QString us = wpt_tmp->description.mid(u);
wpt_tmp->AddUrlLink(us);
}
}
-#else
- } else if (NULL != (url=strstr(wpt_tmp->description, "{URL="))) {
- *url = '\0';
- url += 5;
- url[strlen(url)-1] = '\0';
- wpt_tmp->AddUrlLink(url);
- }
-#endif
if (rec->image_name) {
wpt_tmp->icon_descr = rec->image_name;
sprintf(extra, "{URL=%s}", l.url_.toUtf8().data());
rec->name = xstrappend(rec->name, extra);
xfree(extra);
- rec->url = xstrdup(l.url_.toUtf8().data());
+ if(rec->url) {
+ xfree(rec->url);
+ }
+ rec->url = xstrdup(l.url_);
}
-#if NEW_STRINGS
if (!wpt->notes.isEmpty()) {
-#else
- if (wpt->notes) {
-#endif
if (rec->comment) {
xfree(rec->comment);
}
wpt_tmp = waypt_new();
wpt_tmp->latitude = DecodeOrd(vert->lat);
wpt_tmp->longitude = -DecodeOrd(vert->lon);
-#if NEW_STRINGS
wpt_tmp->shortname = QString().sprintf("\\%5.5lx", rtserial++);
-#else
- wpt_tmp->shortname = (char*) xmalloc(7);
- sprintf(wpt_tmp->shortname, "\\%5.5lx", rtserial++);
-#endif
fs_chain_add(&wpt_tmp->fs,
(format_specific_data*)vert);
route_add_wpt(rte_head, wpt_tmp);